home *** CD-ROM | disk | FTP | other *** search
- package Forms
- {
- import flash.events.Event;
- import flash.events.MouseEvent;
- import flash.system.fscommand;
- import flash.text.TextField;
-
- [Embed(source="/_assets/assets.swf", symbol="Forms.TitleForm")]
- public class TitleForm extends CluelessBaseForm
- {
-
-
- public var _tfContinue:TextField;
-
- internal var bStartGame:Boolean = false;
-
- public var _bOptions:Button;
-
- protected var _aFilterEnabled:Array;
-
- protected var _aFilterDisabled:Array;
-
- public var _tfOptions:TextField;
-
- public var _bPlay:Button;
-
- internal var playintro:Boolean = true;
-
- public function TitleForm()
- {
- playintro = true;
- bStartGame = false;
- super();
- Music = "MenuMusic";
- localize(_tfContinue,"PLAY");
- localize(_tfOptions,"OPTIONS");
- this.getChildByName("_bPlay").addEventListener(MouseEvent.CLICK,onPlay,false,0,true);
- this.getChildByName("_bOptions").addEventListener(MouseEvent.CLICK,onOptions,false,0,true);
- _tfContinue.mouseEnabled = false;
- installMouseOverSound(_bPlay);
- installMouseOverSound(_bOptions);
- }
-
- public static function getLevelForm(param1:String) : BaseForm
- {
- var _loc2_:DressupForm = null;
- var _loc3_:DressupLevelInfo = null;
- var _loc4_:CutsceneForm = null;
- _loc2_ = new DressupForm();
- _loc3_ = new DressupLevelInfo(param1);
- _loc2_.init(_loc3_);
- if(_loc3_.LevelCutscene != "")
- {
- (_loc4_ = new CutsceneForm()).init(_loc2_,_loc3_.LevelCutscene);
- return _loc4_;
- }
- return _loc2_;
- }
-
- override public function onUnfocus() : void
- {
- super.onUnfocus();
- }
-
- protected function onOnline(param1:MouseEvent) : void
- {
- setForm(new SnapshotForm());
- }
-
- protected function onHighScore(param1:MouseEvent) : void
- {
- setForm(new HighScoreForm());
- }
-
- override public function onFocus() : void
- {
- super.onFocus();
- if(Profile.ProfileList.length > 0)
- {
- Storage.getInstance().deleteProfile("Cher");
- }
- Storage.getInstance().createStartingProfile();
- playintro = true;
- if(Profile.CurrentProfile.Ending == 1)
- {
- Profile.CurrentProfile.Ending = 0;
- setForm(new HighScoreForm());
- }
- if(bStartGame == true)
- {
- bStartGame = false;
- StartGame();
- }
- }
-
- protected function StartGame() : void
- {
- var _loc1_:CutsceneForm = null;
- Profile.CurrentProfile.TutorialMask = 0;
- Profile.CurrentProfile.bTutorial = 0;
- if(playintro == true)
- {
- _loc1_ = new CutsceneForm();
- _loc1_.init(getLevelForm("Tutorial"),"MainIntro1");
- setForm(_loc1_);
- }
- else
- {
- setForm(getLevelForm("Tutorial"));
- }
- }
-
- protected function OnHidePopup(param1:Event) : void
- {
- }
-
- protected function onChangeProfile(param1:Event) : void
- {
- setForm(new ProfileForm());
- }
-
- protected function onExit(param1:MouseEvent) : void
- {
- fscommand("quit","");
- MainDocument.forceQuit();
- }
-
- protected function onPlay(param1:MouseEvent) : void
- {
- StartGame();
- }
-
- protected function onCredits(param1:MouseEvent) : void
- {
- setForm(new CreditsForm());
- }
-
- protected function onOptions(param1:MouseEvent) : void
- {
- setForm(new OptionsForm());
- }
-
- protected function onNewGame(param1:MouseEvent) : void
- {
- if(Profile.ProfileList.length == 0)
- {
- bStartGame = true;
- setForm(new ProfileCreatePopupForm(),true);
- }
- else
- {
- if(Profile.CurrentProfile.bRestartgame)
- {
- Profile.CurrentProfile.resetCurrentProfile();
- Storage.getInstance().saveProfiles();
- StartGame();
- }
- StartGame();
- }
- }
-
- protected function onCreateNew(param1:Event) : void
- {
- Profile.CurrentProfile.resetCurrentProfile();
- Storage.getInstance().saveProfiles();
- StartGame();
- }
-
- protected function onMemory(param1:MouseEvent) : void
- {
- }
- }
- }
-